<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
<%
	String path = request.getContextPath();
	String basePath = request.getScheme() + "://"
			+ request.getServerName() + ":" + request.getServerPort()
			+ path + "/";
%>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<meta http-equiv="content-language" content="zh-CN" />
<title>茅台账号查询</title>
<link rel="stylesheet" type="text/css"
	href="jquery-easyui-1.5.4.2/themes/default/easyui.css">
	<link rel="stylesheet" type="text/css"
		href="jquery-easyui-1.5.4.2/themes/icon.css">
		<link rel="stylesheet" type="text/css"
			href="jquery-easyui-1.5.4.2/demo/demo.css">
			<script type="text/javascript"
				src="jquery-easyui-1.5.4.2/jquery.min.js"></script>
			<script type="text/javascript"
				src="jquery-easyui-1.5.4.2/jquery.easyui.min.js"></script>
			<script type="text/javascript"
				src="jquery-easyui-1.5.4.2/locale/easyui-lang-zh_CN.js"></script>
</head>
<body>
	<table>
		<tr>
			<td>支付宝账号:</td>
			<td>
				<input id="zfbcode" class="easyui-textbox" style="width:100%;height:32px">
			</td>
			
			<td>
				<a href="javascript:void(0)" class="easyui-linkbutton" onclick="Search()">查询</a>
			</td>
		</tr>
	</table>
	
	<table id="dg" class="easyui-datagrid" title="账号信息" style="width:100%;height:300px"
			data-options="rownumbers:true,
				singleSelect:true,
				autoRowHeight:false,
				pagination:true,
				pageSize:50">
		<thead>
			<tr>
				<th data-options="field:'zfbcode',width:200">支付宝账号</th>
				<th data-options="field:'code',width:100">茅台账号</th>
				<th data-options="field:'pwd',width:100">茅台密码</th>
				<th data-options="field:'tel',width:100">电话</th>
				<th data-options="field:'qq',width:100">QQ</th>
			</tr>
		</thead>
	</table>
	<table id="dg2" class="easyui-datagrid" title="订单信息" style="width:100%;height:300px"
			data-options="rownumbers:true,
				singleSelect:true,
				autoRowHeight:false,
				pagination:true,
				pageSize:50">
		<thead>
			<tr>
				<th data-options="field:'orderNo',width:150">订单编号</th>
				<th data-options="field:'orderTime',width:150">订单时间</th>
				<th data-options="field:'code',width:100">茅台账号</th>
				<th data-options="field:'pwd',width:100">茅台密码</th>
				<th data-options="field:'facestatus',width:100">刷脸状态</th>
				<th data-options="field:'tel',width:100">电话</th>
				<th data-options="field:'address',width:300">地址</th>
				<th data-options="field:'statusname',width:100">订单状态</th>
				<th data-options="field:'kuaiditype',width:60">快递类型</th>
				<th data-options="field:'kuaidicode',width:100">快递单号</th>
			</tr>
		</thead>
	</table>
	<script>
		
		function Search() {  
			var zfbcode = $('#zfbcode').textbox('getValue');
			if(zfbcode=='') {
				alert("请填写支付宝账号");
				return;
			}
			var path = "getMaotaiCodeItem";  
			$.ajax({  
					url : path,  
					type : "post",  
					data : {  
						zfbcode : zfbcode  
					},  
				dataType : "json",  
				success : function(datas) {  
					$('#dg').datagrid({loadFilter:pagerFilter}).datagrid('loadData',datas);  
				}  
			});  
			path = "getMaotaiOrderItem";  
			$.ajax({  
					url : path,  
					type : "post",  
					data : {  
						zfbcode : zfbcode  
					},  
				dataType : "json",  
				success : function(datas) {  
					$('#dg2').datagrid({loadFilter:pagerFilter}).datagrid('loadData',datas);  
				}  
			});  
		}  
		function pagerFilter(data){
			if (typeof data.length == 'number' && typeof data.splice == 'function'){	// is array
				data = {
					total: data.length,
					rows: data
				}
			}
			var dg = $(this);
			var opts = dg.datagrid('options');
			var pager = dg.datagrid('getPager');
			pager.pagination({
				onSelectPage:function(pageNum, pageSize){
					opts.pageNumber = pageNum;
					opts.pageSize = pageSize;
					pager.pagination('refresh',{
						pageNumber:pageNum,
						pageSize:pageSize
					});
					dg.datagrid('loadData',data);
				}
			});
			if (!data.originalRows){
				data.originalRows = (data.rows);
			}
			var start = (opts.pageNumber-1)*parseInt(opts.pageSize);
			var end = start + parseInt(opts.pageSize);
			data.rows = (data.originalRows.slice(start, end));
			return data;
		}
	</script>
</body>






